<?php
// +----------------------------------------------------------------------
// | zhanshop-marketing / AdListen.php    [ 2024/12/23 15:25 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2011~2024 zhangqiquan All rights reserved.
// +----------------------------------------------------------------------
// | Author: zhangqiquan <768617998@qq.com>
// +----------------------------------------------------------------------
declare (strict_types=1);

namespace app\provider;

use app\library\AdCallQueue;
use zhanshop\App;

class AdListenProvider
{
    /**
     * 检测数据写入入口
     * @param string $app
     * @param string $platform
     * @param string $event
     * @param array|null $data
     * @return mixed
     */
    public function listen(string $app, string $platform, string $event, ?array $data, ?array $query = [])
    {
        return $this->$platform($app, $event, $data, $query);
    }

    /**
     * vivo广告监测写入
     * 【第一步先创建应用】https://open-ad.vivo.com.cn/application/index
     * 【第二步收取拿到code】授权页面的地址为
     * https://open-ad.vivo.com.cn/OAuth?clientId={您的client_id }&state={开发者标识}&redirectUri={您的redirectUri} 注意： redirectUri（回调地址）域名需与申请应用时填写的redirectUri域名一致；state必填（内容不限）例如：授权的营销平台账户名称或账户ID。
     * 【第三步配置client_id、client_secret、grant_code、src_id、pkg_name 开始生成token
     * 【第四步配置广告检测】http://127.0.0.1:7201/v1/ad.listen/zhanshop/vivo/click/CEgm1pj2JXNmnlEI1gn2JdHryzcsHbxq1huin_2BlBvDM_3D?pkg_name=包名&src_type=APP&src_id=数据源 【应用商店服务端使用】，https://127.0.0.1/v1/ad.listen/zhanshop/vivo/click/CEgm1pj2JXNmnlEI1gn2JdHryzcsHbxq1huin_2BlBvDM_3D?pkg_name=包名&src_type=APP&src_id=数据源&os=__OS__&imei=__IMEI__&ip=__IP__&oaid=__OAID__&oaidplain=__OAIDPLAIN__&ua=__UA__&android_id=__ANDROIDID__&location=__LOCATION__&requestId=__REQUESTID__&requesttime=__REQUESTTIME__&osversion=__OSVERSION__&model=__MODEL__&lang=__LANG__&resolution=__RESOLUTION__&nettype=__NETTYPE__&ts=__TS__&advertiserId=__ADVERTISERID__&campaignId=__CAMPAIGNID__&groupId=__GROUPID__&adId=__ADID__&adName=__ADNAME__&creativeId=__CREATIVEID__&rtaexp=__RTAEXP__&custom_exp_id=__CUSTOM_EXP_ID__&expinfo=__EXPINFO__ 【非应用商店】
     * 【关于vivo的文档】
     * 1.Marking API
     * https://ad.vivo.com.cn/help?id=380
     * 2.客户端-点击监测
     * https://ad.vivo.com.cn/help?id=353
     * 3.服务端-点击监测：
     * https://ad.vivo.com.cn/help?id=352
     * 4.数据回传相关的文档
     * https://open-ad.vivo.com.cn/doc/index?id=217
     * @param string $app
     * @param string $event
     * @param array|null $data
     * @return void
     */
    public function vivo(string $app, string $event, ?array $datas, ?array $query)
    {
        if($event == "subscribe"){
            return '{"code": 0, "msg": "操作成功"}';
        }

        if(isset($datas[0])){
            foreach($datas as $data){
                $oaid = $data['oaid'] ?? '';
                $imei = $data['imei'] ?? '';
                $androidId = $data['android_id'] ?? '';
                if(strlen(str_replace('0', '', $imei)) <= 5){
                    $imei = '';
                }
                if(strlen(str_replace('0', '', $oaid)) <= 5){
                    $oaid = '';
                }

                $ipv4 = $data['ip'] ?? '';
                $ipv6 = $data['ipv6'] ?? '';
                $ua = $data['ua'] ?? '';
                $mac = $data['mac'] ?? '-';
                $os = $data['os'] ?? '1';
                $adid = strval($data['adId'] ?? '0');
                $adName = $data['adName'] ?? '';
                $accountId = strval($data['advertiserId'] ?? '0');
                $campaignId = strval($data['campaignId'] ?? '0');
                $creativeId = strval($data['creativeId'] ?? '0');
                unset($data['oaid'], $data['imei'], $data['ipv4'], $data['ipv6'], $data['ua'], $data['mac'], $data['imsi'], $data['adId'], $data['adName'], $data['advertiserId']);
                if($accountId == false || $accountId == '__ADVERTISERID__'){
                    App::error()->setError("无效请求", 400);
                }
                if($query) $data = array_merge($query, $data);
                App::make(AdCallQueue::class)->push($app, 'vivo', $event, $accountId, $campaignId, $adid, $creativeId, $adName, $oaid, $imei, $androidId, '', '', $ipv4, $ipv6, $ua, $os, $mac, $data);
            }
        }else{
            $data = $datas;
            $oaid = $data['oaid'] ?? '';
            $imei = $data['imei'] ?? '';
            $androidId = $data['android_id'] ?? '';
            if(strlen(str_replace('0', '', $imei)) <= 5){
                $imei = '';
            }
            if(strlen(str_replace('0', '', $oaid)) <= 5){
                $oaid = '';
            }

            $ipv4 = $data['ip'] ?? '';
            $ipv6 = $data['ipv6'] ?? '';
            $ua = ($data['ua'] ?? '');
            $mac = $data['mac'] ?? '-';
            $os = $data['os'] ?? '';
            $adid = strval($data['adId'] ?? '0');
            $adName = $data['adName'] ?? '';
            $accountId = $data['advertiserId'] ?? '0';
            $campaignId = strval($data['campaignId'] ?? '0');
            $creativeId = strval($data['creativeId'] ?? '0');
            unset($data['oaid'], $data['imei'], $data['ipv4'], $data['ipv6'], $data['ua'], $data['mac'], $data['adId'], $data['adName'], $data['advertiserId']);
            if($accountId == false || $accountId == '__ADVERTISERID__'){
                App::error()->setError("无效请求", 400);
            }
            App::make(AdCallQueue::class)->push($app, 'vivo', $event, $accountId,$campaignId,  $adid, $creativeId, $adName, $oaid, $imei, $androidId, '', '', $ipv4, $ipv6, $ua, $os, $mac, $data);
        }
        return '{"code": 0, "msg": "操作成功"}';
    }

    /**
     * oppo广告监测写入
     * http://127.0.0.1:7201/v1/ad.listen/zhanshop/oppo/click/CEgm1pj2JXNmnlEI1gn2JdHryzcsHbxq1huin_2BlBvDM_3D?bundle=xx包名&ad=__ADID__&imei=__IMEI__&oaid=__OAID__&ts=__TS__&android_id=__ANDROIDID__&ip=__IP__&ua=$ua$&owner_id=$ownerid$&plan_id=$planid$&group_id=$groupid$ 【oppo应用商店广告监测】
     * https://127.0.0.1:7201/v1/ad.listen/zhanshop/oppo/click/Se8Ok1sjW07fkZz_2FkOel6BtVWECO6jFTWEZTOcMIxDY_3D?bundle=包名&event_code=站内激活代码&os=$os$&os_version=$ov$&model=$m$&lang=$lan$&country=$c$&width=$w$&height=$h$&pkg=$pkg$&app_version=$av$&useragent=$ua$&referer=$rf$&ip=__IP__&ts=__TS__&spuid=$spuid$&imei=$im$&oaid=__OAID__&ad_id=$ad$&ad_name=$an$&req_id=$req$&owner_id=$ownerid$&plan_id=$planid$&group_id=$groupid$ 【非应用商店广告检测】
     * @param string $app
     * @param string $event
     * @param array|null $data
     * @return void
     * @throws \Exception
     */
    public function oppo(string $app, string $event, ?array $data, ?array $query)
    {
        $oaid = $data['oaid'] ?? '';
        $imei = $data['imei'] ?? '';
        $androidId = $data['android_id'] ?? '';
        if(strlen(str_replace('0', '', $imei)) <= 5){
            $imei = '';
        }
        if(strlen(str_replace('0', '', $oaid)) <= 5){
            $oaid = '';
        }

        if(strlen(str_replace('0', '', $androidId)) <= 5){
            $androidId = '';
        }

        $ipv4 = $data['ip'] ?? '';
        $ipv6 = '';
        $ua = $data['ua'] ?? '';
        $os = '1';
        $mac = "";

        $adid = $data['ad_id'] ?? '';
        $adName = '';
        $accountId = $data['owner_id'] ?? '';
        $ts = $data['ts'] ?? '';
        if($ts == false || $ts == '__TS__'){
            App::error()->setError("无效请求", 400);
        }
        App::make(AdCallQueue::class)->push($app, 'oppo', $event, $accountId, '', $adid, '', $adName, $oaid, $imei, $androidId, '', '', $ipv4, $ipv6, $ua, $os, $mac, $data);
    }

    /**
     * 小米广告监测写入
     * https://api.e.mi.com/doc.html#/1.0.0-mdtag9b26f-omd/document-2bd1c4c260259b072818205a8ae20139【小米广告链接监测】
     * https://api.e.mi.com/doc.html#/1.0.0-mdtag9b26f-omd/document-f0283649125f62138db43c6f5fc25686【小米广告链接上报转化】
     * http://127.0.0.1:7201/v1/ad.listen/zhanshop/xiaomi/click/CEgm1pj2JXNmnlEI1gn2JdHryzcsHbxq1huin_2BlBvDM_3D?response_validate=false&imei=__IMEI__&imei2=__IMEI2__&meid=__MEID__&oaid=__OAID__&click_time=__TS__&app_id=__APPID__&adid=__ADID__&campaign_id=__CAMPAIGNID__&customer_id=__CUSTOMERID__&callback=__CALLBACK__&sign=__SIGN__&expId=__EXPID__&ip=__IP__&ua=__UA__&androidId=__ANDROIDID__&adName=__ADNAME__&rtaExpId=__RTAEXPID__ 【小米广告监测】
     * @param string $app
     * @param string $event
     * @param array|null $data
     * @return void
     * @throws \Exception
     */
    public function xiaomi(string $app, string $event, ?array $data, ?array $query)
    {
        $oaid = $data['oaid'] ?? '';
        $imei = $data['imei'] ?? '';
        $androidId = $data['android_id'] ?? '';
        if(strlen(str_replace('0', '', $imei)) <= 5){
            $imei = '';
        }
        if(strlen(str_replace('0', '', $oaid)) <= 5){
            $oaid = '';
        }

        if(strlen(str_replace('0', '', $androidId)) <= 5){
            $androidId = '';
        }

        $ipv4 = $data['ip'] ?? '';
        $ipv6 = '';
        $ua = $data['ua'] ?? '';
        $os = '1';
        $mac = "";

        $adid = strval($data['adid'] ?? 0);
        $adName = $data['adName'] ?? '';
        $accountId = $data["customer_id"] ?? '0';
        $planId = strval($data["adid"] ?? '0');
        $creativeId = strval($data["campaign_id"] ?? '0');
        $callback = $data['callback'] ?? '';
        if($callback == false || $callback == '__CALLBACK__'){
            App::error()->setError("无效请求", 400);
        }

        App::make(AdCallQueue::class)->push($app, 'xiaomi', $event, $accountId, $planId, $adid, $creativeId, $adName, $oaid, $imei, $androidId, '', '', $ipv4, $ipv6, $ua, $os, $mac, $data);
    }

    /**
     * 华为广告数据写入
     * https://developer.huawei.com/consumer/cn/doc/promotion/bp-functions-link-configure-0000001351658397【华为链接监测文档】
     * https://developer.huawei.com/consumer/cn/doc/promotion/bp-functions-ocpd-interface-return-0000001238484400【华为链接监测上报转化文档】
     * http://127.0.0.1:7201/v1/ad.listen/zhanshop/huawei/click/CEgm1pj2JXNmnlEI1gn2JdHryzcsHbxq1huin_2BlBvDM_3D?aid=__AID__&aid_name=__AID_NAME__&app_id=__APP_ID__&app_name=__APP_NAME__&channel_name=__CHANNEL_NAME__&channel_id=__CHANNEL_ID__&group_name=__GROUP_NAME__&group_id=__GROUP_ID__&oaid=__OAID__&id_type=__ID_TYPE__&unique_id=__UNIQUE_ID__&action_type=__ACTION_TYPE__&ts=__TS__&callback=__CALLBACK__&sub_taskid=__SUB_TASKID__&rtaid=__RTAID__ 【华为的广告监测】
     *
     * @param string $app
     * @param string $event
     * @param array|null $data
     * @return void
     */
    public function huawei(string $app, string $event, ?array $data, ?array $query)
    {
        // 华为里面当心有坑就是老设备
        $oaid = $data['oaid'] ?? '';
        $imei = $data['unique_id'] ?? '';
        $os = "1";
        $androidId = '';

        if(strlen(str_replace('0', '', $imei)) <= 5){
            $imei = '';
        }
        if(strlen(str_replace('0', '', $oaid)) <= 5){
            $oaid = '';
        }

        $ipv4 = '';
        $ipv6 = '';
        $ua = '';

        $adid = strval($data['aid'] ?? 0);
        $adName = $data['aid_name'] ?? '';
        $accountId = "0";
        $mac = $data['mac'] ?? '-';
        $callback = $data['callback'] ?? '-';
        if($callback == false || $callback == '__CALLBACK__'){
            App::error()->setError("无效请求", 400);
        }
        $planId = '';
        $creativeId = '';
        unset($data['aid'], $data['aid_name']);

        App::make(AdCallQueue::class)->push($app, 'huawei', $event, $accountId, $planId, $adid, $creativeId, $adName, $oaid, $imei, $androidId, '', '', $ipv4, $ipv6, $ua, $os, $mac, $data);
    }

    /**
     * 巨量广告监测写入
     * https://open.oceanengine.com/labels/7/docs/1696710655781900 【巨量引擎广告监测文档】
     * http://127.0.0.1:7201/v1/ad.listen/zhanshop/byte/click/CEgm1pj2JXNmnlEI1gn2JdHryzcsHbxq1huin_2BlBvDM_3D?promotion_id=__PROMOTION_ID__&project_id=__PROJECT_ID__&promotion_name=__PROMOTION_NAME__&project_name=__PROJECT_NAME__&mid1=__MID1__&mid2=__MID2__&mid3=__MID3__&mid4=__MID4__&mid5=__MID5__&mid6=__MID6__&aid=__AID__&aid_name=__AID_NAME__&cid=__CID__&cid_name=__CID_NAME__&campaign_id=__CAMPAIGN_ID__&campaign_name=__CAMPAIGN_NAME__&ctype=__CTYPE__&advertiser_id=__ADVERTISER_ID__&csite=__CSITE__&convert_id=__CONVERT_ID__&request_id=__REQUEST_ID__&track_id=__TRACK_ID__&sl=__SL__&imei=__IMEI__&idfa=__IDFA__&idfa_md5=__IDFA_MD5__&android_id=__ANDROIDID__&oaid=__OAID__&oaid_md5=__OAID_MD5__&os=__OS__&mac=__MAC__&mac1=__MAC1__&ipv4=__IPV4__&ipv6=__IPV6__&ip=__IP__&ua=__UA__&geo=__GEO__&ts=__TS__&callback_param=__CALLBACK_PARAM__&callback_url=__CALLBACK_URL__&model=__MODEL__&union_site=__UNION_SITE__&caid=__CAID__&caid_md5=__CAID_MD5__&productid=__PRODUCTID&outerid=__OUTERID__
     * @param string $app
     * @param string $event
     * @param array|null $data
     * @return void
     */
    public function byte(string $app, string $event, ?array $data, ?array $query)
    {
        $oaid = $data['oaid'] ?? '';
        $imei = $data['imei'] ?? '';
        $androidId = $data['android_id'] ?? '';
        $idfa = $data['idfa'] ?? '';
        $mac = $data['mac'] ?? '';
        if(strlen(str_replace('0', '', $imei)) <= 5){
            $imei = '';
        }
        if(strlen(str_replace('0', '', $oaid)) <= 5){
            $oaid = '';
        }

        if(strlen(str_replace('0', '', $idfa)) <= 5){
            $idfa = '';
        }

        if(strlen(str_replace('0', '', $androidId)) <= 5){
            $androidId = '';
        }

        if(strlen(str_replace('0', '', $mac)) <= 5){
            $mac = '';
        }

        $ipv4 = $data['ipv4'] ?? '';
        $ipv6 = $data['ipv6'] ?? '';
        $ua = $data['ua'] ?? '';
        $os = $data['os'] ?? '';

        $adid = strval($data['promotion_id'] ?? 0);
        $adName = $data['promotion_name'] ?? '';
        $accountId = $data["advertiser_id"] ?? '0';

        $callbackParam = $data['callback_param'] ?? '';
        if($callbackParam == false || $callbackParam == '__CALLBACK_PARAM__'){
            App::error()->setError("无效请求", 400);
        }
        unset($data['oaid'], $data['imei'], $data['android_id'], $data['ipv4'], $data['ipv6'], $data['ip'], $data['ua'], $data['os'], $data['mac'], $data["advertiser_id"], $data['promotion_id'], $data['promotion_name'], $data["advertiser_id"]);
        $planId = strval($data['aid'] ?? '0');
        $creativeId = strval($data['cid'] ?? '0');
        App::make(AdCallQueue::class)->push($app, 'byte', $event, $accountId, $planId, $adid, $creativeId, $adName, $oaid, $imei, $androidId, $idfa, '', $ipv4, $ipv6, $ua, $os, $mac, $data);
    }

    /**
     * 百度广告监测写入
     * https://dev2.baidu.com/content?sceneType=0&pageId=101214&nodeId=662&subhead= 【百度广告监测文档】
     * http://127.0.0.1:7201/v1/ad.listen/zhanshop/baidu/click/CEgm1pj2JXNmnlEI1gn2JdHryzcsHbxq1huin_2BlBvDM_3D?aid=__IDEA_ID__&pid=__PLAN_ID__&uid=__UNIT_ID__&userid=__USER_ID__&click_id=__CLICK_ID__&idfa=__IDFA__&imei=__IMEI__&android_id=__ANDROIDID__&ip=__IP__&ua=__UA__&os=__OS__&ts=__TS__&ext_info=__EXT_INFO__&mac_md5=__MAC1__&mac=__MAC__&oaid=__OAID__&oaid_md5=__OAID_MD5__&comb_id=__COMBID__&size=__SIZE__&deeplink_url=__DEEPLINK_URL__&bd_vid=__BD_VID__&ext_info=__EXT_INFO__&callType=v2
     * @param string $app
     * @param string $event
     * @param array|null $data
     * @return void
     */
    public function baidu(string $app, string $event, ?array $data, ?array $query)
    {
        $extInfo =  $data['ext_info'] ?? '';
        if($extInfo == false || $extInfo == '__EXT_INFO__'){
            App::error()->setError("无效请求", 400);
        }

        $oaid = $data['oaid'] ?? '';
        $imei = $data['imei'] ?? '';
        $androidId = $data['android_id'] ?? '';
        $idfa = $data['idfa'] ?? '';
        $mac = $data['mac'] ?? '';
        $iddi = $data['bd_vid'] ?? '';
        if(strlen(str_replace('0', '', $imei)) <= 5){
            $imei = '';
        }
        if(strlen(str_replace('0', '', $oaid)) <= 5){
            $oaid = '';
        }

        if(strlen(str_replace('0', '', $idfa)) <= 5){
            $idfa = '';
        }

        if(strlen(str_replace('0', '', $androidId)) <= 5){
            $androidId = '';
        }

        if(strlen(str_replace('0', '', $mac)) <= 5){
            $mac = '';
        }

        if(strlen(str_replace('0', '', $iddi)) <= 5){
            $iddi = '';
        }

        $ua = $data['ua'] ?? '';
        $os = $data['os'] ?? '';

        $ipv4 = '';
        $ipv6 = '';
        $ipType = $data['ip_type'] ?? 'v4';
        if($ipType != 'v4'){
            $ipv6 = $data['ip'];
        }else{
            $ipv4 = $data['ip'];
        }

        $adid = strval($data['aid'] ?? 0);
        $adName = '';
        $accountId = $data["userid"] ?? '0';

        unset($data['oaid'], $data['imei'], $data['android_id'], $data['ua'], $data['os'], $data['mac']);
        $planId = strval($data['pid'] ?? '0');
        $creativeId = strval($data['aid'] ?? '0');
        App::make(AdCallQueue::class)->push($app, 'baidu', $event, $accountId, $planId, $adid, $creativeId, $adName, $oaid, $imei, $androidId, $idfa, $iddi, $ipv4, $ipv6, $ua, $os, $mac, $data);
    }

    /**
     * 荣耀广告检测
     * https://ads.honor.com/help/1738095811504373761 【荣耀广告回传文档】
     * http://127.0.0.1:7201/v1/ad.listen/zhanshop/honor/click/qpOltkBneLUgVD3eslB_2FQwdbKk9hvNvWUEttZjOEgqPw_3D_3D 【荣耀的广告监测使用自动拼装】
     * @param string $app
     * @param string $event
     * @param array|null $data
     * @return void
     */
    public function honor(string $app, string $event, ?array $data, ?array $query)
    {
        $oaid = $data['oaid'] ?? '';
        $imei = $data['imei'] ?? '';

        if(strlen(str_replace('0', '', $imei)) <= 5){
            $imei = '';
        }
        if(strlen(str_replace('0', '', $oaid)) <= 5){
            $oaid = '';
        }

        $androidId = $data['android_id'] ?? '';
        $idfa = $data['idfa'] ?? '';
        $ipv4 = $data['ip'] ?? '';
        $ipv6 = '';
        $ua = $data['ua'] ?? '';
        $os = $data['os'] ?? '';
        $mac = '';

        $adid = strval($data['campaign_id'] ?? 0);
        $adName = $data['promotion_name'] ?? '';
        $accountId = $data["advertiser_id"] ?? '0';
        $planId = strval($data['campaign_id'] ?? '0');
        $creativeId = '';
        App::make(AdCallQueue::class)->push($app, 'honor', $event, $accountId, $planId, $adid, $creativeId, $adName, $oaid, $imei, $androidId, $idfa, '', $ipv4, $ipv6, $ua, $os, $mac, $data);
    }

    /**
     * 快手广告监测  https://docs.qingque.cn/d/home/eZQDdHqmKNlqFsDU3O0TAJB3T?identityId=1oE1bwPW1uG#section=h.nvuwrykyhlhf
     * https://127.0.0.1/v1/ad.listen/luyin/kuaishou/click/CEgm1pj2JXNmnlEI1gn2JdHryzcsHbxq1huin_2BlBvDM_3D?adsocial_uid=__ADSOCIAL_UID__&adsocial_aid=__ADSOCIAL_AID__&accountid=__ACCOUNTID__&mission_id=__MISSION_ID__&order_id=__ORDER_ID__&cid=__CID__&did=__DID__&vid=__VID__&csite=__CSITE__&supplement_order_id=__SUPPLEMENT_ORDER_ID__&supplement_version=__SUPPLEMENT_VERSION__&traffic_source=__TRAFFIC_SOURCE__&ks_order_id=__KS_ORDER_ID__&photo_id=__PHOTO_ID__&eventid=__EVENTID__&requestid=__REQUESTID__&llsid=__LLSID__&imei2=__IMEI2__&imei3=__IMEI3__&oaid=__OAID__&oaid2=__OAID2__&idfa2=__IDFA2__&idfa3=__IDFA3__&kenyid_caa=__KENYID_CAA__&mac=__MAC__&mac2=__MAC2__&mac3=__MAC3__&androidid2=__ANDROIDID2__&androidid3=__ANDROIDID3__&ts=__TS__&ip=__IP__&ipv6=__IPV6__&ipv4=__IPV4__&fingerprint_time=__FINGERPRINT_TIME__&model=__MODEL__&os=__OS__&ua=__UA__&callback=__CALLBACK__
     * @param string $app
     * @param string $event
     * @param array|null $data
     * @return void
     * @throws \Exception
     */
    public function kuaishou(string $app, string $event, ?array $data, ?array $query)
    {
        $callback =  $data['callback'] ?? '';
        if($callback == false || $callback == '__CALLBACK__'){
            App::error()->setError("无效请求", 400);
        }
        $oaid = $data['oaid'] ?? '';
        $imei = $data['imei2'] ?? '';

        if(strlen(str_replace('0', '', $imei)) <= 5){
            $imei = '';
        }
        if(strlen(str_replace('0', '', $oaid)) <= 5){
            $oaid = '';
        }

        $androidId = $data['android_id2'] ?? '';
        $idfa = $data['idfa2'] ?? '';
        $ipv4 = $data['ipv4'] ?? '';
        $ipv6 = $data['ipv6'] ?? '';
        $ua = $data['ua'] ?? '';
        $os = $data['os'] ?? '';
        $mac = $data['mac'] ?? '';

        $adid = '';
        $adName = $data["dname"] ?? '';
        $accountId = $data["accountid"] ?? '0';
        $planId = strval($data['did'] ?? '0');
        $creativeId = strval($data['cid'] ?? '0');
        App::make(AdCallQueue::class)->push($app, 'kuaishou', $event, $accountId, $planId, $adid, $creativeId, $adName, $oaid, $imei, $androidId, $idfa, '', $ipv4, $ipv6, $ua, $os, $mac, $data);
    }
}